#pragma once

//Highlevel packet ID
#define PACKET_NETWORK				(0x1000)
#define PACKET_QUERY				(0x2000)
#define PACKET_UPDATE				(0x4000)

#define NETWORK_PROBE				(PACKET_NETWORK | 0x1)
#define NETWORK_DISCONNECT			(PACKET_NETWORK | 0x2)

#define UPDATE_SELECTION			(PACKET_UPDATE | 0x1)
#define UPDATE_TRANSFORM			(PACKET_UPDATE | 0x2)
#define UPDATE_MODE					(PACKET_UPDATE | 0x4)
#define UPDATE_INSTANCESAMPLER		(PACKET_UPDATE | 0x8)
#define UPDATE_SURFACETEXTURE		(PACKET_UPDATE | 0x10)
#define UPDATE_GEOMETRY				(PACKET_UPDATE | 0x20)
#define UPDATE_MESHINSTANCING		(PACKET_UPDATE | 0x80)
#define UPDATE_SCENELIGHTS			(PACKET_UPDATE | 0x100)
#define UPDATE_PARAMETERS			(PACKET_UPDATE | 0x200)
#define UPDATE_DEFORMATION			(PACKET_UPDATE | 0x400)

#define QUERY_RESPONCE_OBJECTEXISTS	(PACKET_QUERY | 0x1)
#define QUERY_RESPONCE_SYNCHRONIZED	(PACKET_QUERY | 0x2)

#define VERTEX_POSITION			0x1
#define VERTEX_NORMAL			0x2
#define VERTEX_TANGENT			0x4
#define VERTEX_UV0				0x8
#define VERTEX_UV1				0x10
#define VERTEX_UV2				0x20
#define VERTEX_COLOR			0x40
#define VERTEX_DEFORMATION		0x80
#define VERTEX_INSTANCE_POSITION	0x100
#define VERTEX_INSTANCE_ROTATION	0x200
#define VERTEX_ELEMENT_COUNT	10 //8

/*
Feature Set
*/
#define SAMPLE_TEXTURE		(1<<0)
#define SAMPLE_WOOD			(1<<1)
#define SAMPLE_NOISE		(1<<2)
#define SAMPLE_GRID			(1<<3)
#define SAMPLE_RAMP			(1<<4)
#define SAMPLE_CHECKER		(1<<5)
#define SAMPLE_RESERVED1	(1<<6)
#define SAMPLE_COUNT		7

#define DIMENSIONS_2D		(0<<7)
#define DIMENSIONS_3D		(1<<7)

#define CHANNEL_BITWIDTH	8
#define CHANNEL_DECAL		(0 * CHANNEL_BITWIDTH)
#define CHANNEL_NORMAL		(1 * CHANNEL_BITWIDTH)
#define CHANNEL_SPECULAR	(2 * CHANNEL_BITWIDTH)
#define CHANNEL_COUNT		3
#define INSTANCE_STREAMING	(1<<(3 * CHANNEL_BITWIDTH))


#define CREATE_CHANNEL(channel, samples, dimension)	(((samples) | (dimension)) << (channel))

extern unsigned int GetVertexFormatSize(unsigned int format);
//extern unsigned int GetProceduralFormatSize(PROCEDURAL_FORMAT format);
